package com.yupi.yuapiinterface.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yupi.yuapiinterface.mapper.UserMapper;
import com.yupi.yuapiinterface.model.DTO.UserDTO;
import com.yupi.yuapiinterface.model.User;
import com.yupi.yuapiinterface.service.UserService;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;

/**
* @author 20654
*/
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User>
    implements UserService {

    @Override
    public String getUserByName(UserDTO userDto, HttpServletRequest request) {
        String result = userDto.getUsername();
        System.out.println("UserServiceImpl.getUserByName - 接收到的username: " + userDto.getUsername());
        System.out.println("UserServiceImpl.getUserByName - 返回结果: " + result);
        return result;
    }

    @Override
    public User getByAccessKey(String accessKey) {
        return this.getOne(new QueryWrapper<User>().eq("accessKey", accessKey));
    }
}




